{include file="public/header" /}
<body class="hide-top bgc">
<div class="submit-container">
    <img src="/static/index/img/icon50.png" alt="">
    <div class="submit-content">
        <div class="submit-hd flex-center">
            <i class="layui-icon layui-icon-left" onclick="goBack()"></i>订单详情
        </div>
        <div class="order-det-staute">
            <p class="order-det-status">{$info.friendlyText}</p>
        </div>
        <div class="submit-site flex-layout order-det-site">
            <div>
                <div>
                    <img src="/static/index/img/icon56.png" alt="">{$info.receiver} {$info.receiver_tel}
                </div>
                <p>{$info.p?$info.p.title:''} {$info.c?$info.c.title:''} {$info.d?$info.d.title:''} {$info.address_details}</p>
            </div>
        </div>
        <div class="submit-pro">
            <ul class="submit-pro-list">
                {foreach name="info.productsField" item="vo"}
                <li>
                    <p class="flex-center">
                        <img src="{$vo.icon}" alt="">
                    </p>
                    <div class="center">
                        <p class="multi">{$vo.title}</p>
                        <p class="spec">{$vo.spec}</p>
                    </div>
                    <div class="rgt">
                        <p class="price">￥<span>{$vo.vip_price}</span></p>
                        <p>x{$vo.num}</p>
                    </div>
                </li>
                {/foreach}
            </ul>
            {if $info.remark}
            <ul class="submit-pro-form">
                <li>留言：{$info.remark}</li>
            </ul>
            {/if}
        </div>
        <div class="submit-pro">
            <ul class="submit-pro-form">
                <li>商品总额
                    <p>￥{$info.total_amount}</p>
                </li>
                <li class="real-money">实付款：<span>￥{$info.real_amount}</span></li>
            </ul>
        </div>
        <ul class="order-det-form">
            <li>
                <p class="name">订单号：</p>
                <p id="sn">{$info.sn}</p>
                <span class="copy flex-center" data-clipboard-target="#sn">复制</span>
            </li>
            <li>
                <p class="name">下单时间：</p>
                <p>{$info.create_time}</p>
            </li>
            {if $info.pay_time}
            <li>
                <p class="name">支付方式：</p>
                <p>{$info.pay_way}</p>
            </li>
            <li>
                <p class="name">支付时间：</p>
                <p>{$info.pay_time}</p>
            </li>
            {/if}
            {if $info.post_time}
            <li>
                <p class="name">发货时间：</p>
                <p>{$info.post_time}</p>
            </li>
            {/if}
            {if $info.express}
            <li>
                <p class="name">物流公司：</p>
                <p>{$info.express.title}</p>
            </li>
            {/if}
            {if $info.express_code}
            <li>
                <p class="name">物流单号：</p>
                <p id="express_code">{$info.express_code}</p>
                <span class="copy flex-center" data-clipboard-target="#express_code">复制</span>
            </li>
            {/if}
            {if $info.receipt_time}
            <li>
                <p class="name">收货时间：</p>
                <p>{$info.receipt_time}</p>
            </li>
            {/if}
            {if $info.refund_time}
            <li>
                <p class="name">退款时间：</p>
                <p>{$info.refund_time}</p>
            </li>
            {/if}
            {if $info.finish_time}
            <li>
                <p class="name">完成时间：</p>
                <p>{$info.finish_time}</p>
            </li>
            {/if}
            {if $info.cancel_time}
            <li>
                <p class="name">取消时间：</p>
                <p>{$info.cancel_time}</p>
            </li>
            {/if}
        </ul>
    </div>
</div>
{if $info->uid == $user->id}
{if $info->getData('status') == 1}
<div class="orderDet-footer bottom">
    <p class="flex-center cancel" style="border: 1px solid #999;color:#999;" data-id="{$info.id}">取消订单</p>
    <p class="flex-center bc" onclick="load_href('{:url(\'order/payment\')}?id={$info.id}',2)">去支付</p>
</div>
{elseif $info->getData('status') == 3}
<div class="orderDet-footer bottom">
    <p class="flex-center bc receipt" data-id="{$info.id}">确认收货</p>
</div>
{/if}
{/if}
</body>
{include file="public/footer" /}
<script src="/static/index/js/clipboard.min.js"></script>
<script>
    $(function () {
        $('.copy').click(function() {
            var clipboard = new ClipboardJS('.copy');
            clipboard.on("success",function(e){
                e.clearSelection();
                layer.msg('复制成功');
            });
            clipboard.on("error",function(){
                layer.msg('复制失败');
            });
        });
        $(".cancel").click(function () {
            edit('cancel', '确认要取消订单吗？');
        });
        $(".receipt").click(function () {
            edit('receipt', '是否确认收货？');
        });
        function edit(type, msg) {
            layer.confirm(msg, {title: '请确认'}, function () {
                return common.request('{:url("order/edit")}', {type: type, id: '{$info.id}'});
            });
        }
    });
</script>
</html>